/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface ShopCusFlHx extends BasicModel<ShopCusFlHx> {
  compName?: string; // 分公司名称
  payType?: string; // 支付方式
  bsp?: string; // 是否收票
  fpType?: string; // 发票类型
  writeOffAmount?: number; // 本次核销金额
  cusCode?: string; // 客户编码
  cusName?: string; // 客户名称
  cusLevel?: string; // 客户级别
  auditDate?: string; // 审核日期
}

export const shopCusFlHxList = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/list', params });

export const shopCusFlHxListData = (params?: ShopCusFlHx | any) =>
  defHttp.post<Page<ShopCusFlHx>>({ url: adminPath + '/shop/cus/shopCusFlHx/listData', params });

export const shopCusFlHxForm = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/form', params });

export const shopCusFlHxSave = (params?: any, data?: ShopCusFlHx | any) =>
  defHttp.postJson<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/save', params, data });

export const shopCusFlHxImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/shop/cus/shopCusFlHx/importData',
      onUploadProgress,
    },
    params,
  );

export const shopCusFlHxDelete = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/delete', params });

export const shopCusFlHxConfirm = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/confirm', params });

export const shopCusFlHxCancel = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/cancel', params });

export const shopCusFlHxBacthDel = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/batchDelete', params });

export const shopCusFlHxEnableAll = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/enableAll', params });

export const shopCusFlHxDelByExpId = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/deleteByExpID', params });

export const getYeMoney = (params?: ShopCusFlHx | any) =>
  defHttp.get<ShopCusFlHx>({ url: adminPath + '/shop/cus/shopCusFlHx/findSyFlXJ', params });
